{include file="common/header"/}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
              <div class="layui-card-body">
                <div class="layui-row">
                    <table class="layui-table" id="list" lay-filter="list"></table>
                </div>
              </div>
            </div>
        </div>
    </div>
</div>
{include file="common/footer"/}

<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-group">
        <a href="javascript:;" class="layui-btn layui-btn-sm" onclick="open_frame('{:lang('add')}','{:url("add")}');"><i class="layui-icon layui-icon-add-circle"></i>{:lang('add')}</a>
    </div>
    
</script>


<script type="text/html" id="action">
    <div class="layui-btn-group">
        <a class="layui-btn layui-btn-xs layui-btn-warm" onclick="open_frame('模型字段','{:url("field")}?id={{d.id}}');">模型字段</a>
        <a class="layui-btn layui-btn-xs" onclick="open_frame('{:lang('edit')}','{:url("edit")}?id={{d.id}}');">{:lang('edit')}</a>
        <a data-href="{:url('del')}" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{:lang('del')}</a>
    </div>
</script>
<script type="text/html" id="status">
    <input type="checkbox" name="status" data-href="{:url('moduleState')}" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }}>
</script>


<script>
var table;
var searchObj = {};

layui.use(['table','laydate'],function(){
  table = layui.table;
  table.render({
    elem: '#list'
    ,url:'{:url("index")}'
    ,method:'post'
    ,where:searchObj
    ,toolbar: '#toolbarDemo'
    ,defaultToolbar: []
    ,cellMinWidth: 60
    ,limit:20
    ,limits:[20,40,60,80,100]
    ,title: '{:lang("admin")}{:lang("list")}'
    ,id:'tableReload'
    ,cols: [[
        {field:'id', title: 'ID',fixed: true}
        ,{field:'title', title: '模型名称'}
        ,{field:'name', title: '表名'}
        ,{field:'description', title: '描述'}
        ,{field:'status', title: '状态', templet:'#status'}
        ,{title:'操作',toolbar: '#action',align:"center"}
    ]]
    ,page: true
  });
});


</script>
